From: Joey Hess Date: Thu, 21 Aug 2025 20:21:12 +0000 (-0400) Subject: add test case for enableremote changing encryption X-Git-Tag: archive/raspbian/10.20251029-1+rpi1~1^2~3^2~192 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com///%22http:/www.example.com/cgi/%22https:/www.github.com/?a=commitdiff_plain;h=04c39a2df9a9859b6694fed8e323fe65f8fae197;p=git-annex.git add test case for enableremote changing encryption As fixed in 6b63fb7ea29f39b0fe7632dae6951c589115ee37 Sponsored-by: Brock Spratlen --- diff --git a/Test.hs b/Test.hs index 5240d3497d..2fb6d6a03b 100644 --- a/Test.hs +++ b/Test.hs @@ -370,6 +370,7 @@ repoTests note numparts = map mk $ sep , testCase "add subdirs" test_add_subdirs , testCase "addurl" test_addurl , testCase "repair" test_repair + , testCase "enableremote encryption changes" test_enableremote_encryption_changes ] where mk l = testGroup groupname (initTests : map adddep l) @@ -2186,3 +2187,26 @@ test_repair :: Assertion test_repair = intmpclonerepo $ -- Simply running repair used to fail on Windows. git_annex "repair" [] "repair" + +test_enableremote_encryption_changes :: Assertion +test_enableremote_encryption_changes = intmpclonerepo $ do + createDirectory (literalOsPath "dir") + let dirparam="directory=dir" + git_annex "initremote" ["foo", "type=directory", "encryption=none", dirparam] + "initremote" + git_annex_shouldfail "enableremote" ["foo", "encryption=shared", dirparam] + "enableremote adding new encryption" + git_annex "initremote" ["bar", "type=directory", "encryption=shared", dirparam] + "initremote" + git_annex "enableremote" ["bar", "encryption=shared", dirparam] + "enableremote with same encryption" + git_annex_shouldfail "enableremote" ["bar", "encryption=none", dirparam] + "enableremote disabling encryption" + git_annex_shouldfail "enableremote" ["bar", "onlyencryptcreds=yes", dirparam] + "enableremote with onlyencryptcreds" + git_annex "initremote" ["baz", "type=directory", "encryption=shared", "onlyencryptcreds=yes", dirparam] + "initremote" + git_annex_shouldfail "enableremote" ["baz", "onlyencryptcreds=no", dirparam] + "enableremote disabling onlyencryptcreds" + git_annex "enableremote" ["baz", "onlyencryptcreds=yes", dirparam] + "enableremote enabling already enabled onlyencryptcreds"